<?php

namespace App\Http\Resources;

use Illuminate\Http\Resources\Json\Resource;

class CaseCenter extends Resource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
      return [
          'id' => $this->id,
          'title' => $this->title,
          'img' => $this->img,
          'thumb' => $this->thumb,
          'content' => $this->content,
          // 'content' => htmlspecialchars(strip_tags($this->content)),//去除html标签
          'content' => htmlspecialchars($this->content),
      ];
    }
}

// "id": 2,
// "title": "抗震支架2",
// "img": "images/logo.png",
// "thumb": "images/acce0e7ce0b7093ccf0d902080c32a2d.png",
// "content": "这个也很好啊",
